//
//  UIBarButtonItem+HHExtension.m
//  百思不得姐
//
//  Created by hjl on 16/4/11.
//  Copyright © 2016年 hjl. All rights reserved.
//

#import "UIBarButtonItem+HHExtension.h"

@implementation UIBarButtonItem (HHExtension)

+ (instancetype)itemWithImage:(NSString *)image highImage:(NSString *)highImage target:(id)target action:(SEL)action{
    
    UIButton *button = [[UIButton alloc] init];
    [button setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [button setImage:[UIImage imageNamed:highImage] forState:UIControlStateHighlighted];
    button.size = button.imageView.image.size;
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    
    return [[self alloc] initWithCustomView:button];
}
@end
